/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.register.Controller;

/**
 *
 * @author Yogesh
 */
public class SppedyDataStore implements Runnable{

    Thread t;
    com.register.Model.Step1_Model step1;

    public SppedyDataStore(com.register.Model.Step1_Model step1) {

            this.step1=step1;
            t=new Thread(this,"DataStore");
            t.start();

    }

    

    public void run() {

             org.hibernate.SessionFactory sessionFactory=com.Auto.Common.Userinformtion.Hibernate.Userinformation_HibernateUtil.getSessionFactory();
             org.hibernate.Session Opensession=sessionFactory.openSession();
             org.hibernate.Transaction transaction=Opensession.beginTransaction();

             String firstname =step1.getFirstName();
             String lastname=step1.getLastName();
             String mobileNumber=step1.getMobileNumber();
             String emailId=step1.getEmailId();
             String password=step1.getPassword();
             String activationCode=step1.getActivationCode();
             String pic=step1.getPic();


             com.Auto.Common.Userinformtion.Hibernate.Userinformation uinfo=new com.Auto.Common.Userinformtion.Hibernate.Userinformation(firstname,"", lastname, "", mobileNumber, emailId, "", "", password, "", "", "", "",pic, activationCode,"0","1","0");

             //com.Auto.Common.Userinformtion.Hibernate.Userinformation uinfo=new com.Auto.Common.Userinformtion.Hibernate.Userinformation("yogesh","", "paisode", "", "8550900381", "yogesh.paisode@gmail.com", "", "", "yogesh", "", "", "", "",step1.getPic(), "XHSD234HDFH","0","1","0");
            

             Opensession.save(uinfo);
             transaction.commit();
        
    }

}
